package com.beijing.springbootclustersession.controller;

import com.beijing.springbootclustersession.mapper.UserService;
import com.beijing.springbootclustersession.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Authther: mrwu
 * @date:2021/4/1-04
 * @Description:com.beijing.springbootclustersession.controller
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/user")
    public List<User> getalluser(){

        List<User> allUsers = userService.getAllUsers();
        return allUsers;
    }
}
